const fs = require('fs');
const path = require('path');



function build(times) {

    let file = path.join(__dirname, '../examples/platforms/wx/src/yaxi/pages/templates/view.wxml');
    let list = ['<import src="./control.wxml" />'];

    for (let i = 0; i < times; i++)
    {
        list.push(`<template name="View${i}">
    <View id="{{ui.u}}" ui="{{ui}}">
        <template wx:for="{{ui.$}}" wx:key="u" is="{{item.t || 'View${i + 1}'}}" data="{{ui: item}}" />
    </View>
</template>`);
    }

    list.push(`<template name="View${ times }">
    <text>容器嵌套的层数太多了, 最多只能嵌${ times }套层</text>
    <text>There are too many layers nested in the container, with a maximum of ${ times } layers</text>
</template>`);

    fs.writeFileSync(file, list.join('\r\n\r\n\r\n'));
}


build(99);
